var oBtn = document.querySelector(".btn");
var oDiv = document.querySelector("div");
var closeBtn = document.querySelector("span");
var submitBtn = document.querySelectorAll(".btn1")[0];
var cancelBtn = document.querySelectorAll(".btn1")[1];
var oInput = document.querySelectorAll('input')

function clearValue(str) {
  for (var i = 0; i < oInput.length; i++) {
    oInput[i].value = ''
  }
  oDiv.style.display = str
}

oBtn.onclick = function () {
  clearValue('block')
}
closeBtn.onclick = function () {
  clearValue('none')
}
cancelBtn.onclick = function () {
  clearValue('none')
}
submitBtn.onclick = function () {
  clearValue('none')
}